﻿using Newtonsoft.Json;

namespace VideoTools.vo
{
    public class FFmpegCommand
    {
        /// <summary>
        /// 命令名称，不可重复
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// gpu处理的命令
        /// </summary>
        public string gpu { get; set; }
        /// <summary>
        /// cpu处理的命令
        /// </summary>
        public string cpu { get; set; }
        /// <summary>
        /// 生成的文件后缀
        /// </summary>
        public string endwith { get; set; }
        /// <summary>
        /// 获取处理进度的时候的ffmpeg输出的关键词
        /// </summary>
        public string keywords { get; set; }
        /// <summary>
        /// 取处理进度的时候时间
        /// </summary>
        public string regex { get; set; }
        /// <summary>
        /// 命令说明
        /// </summary>
        public string desc { get; set; }

        public FFmpegCommand Clone()
        {
            string v = JsonConvert.SerializeObject(this, Formatting.Indented);
            return JsonConvert.DeserializeObject<FFmpegCommand>(v);
        }

        public override string ToString()
        {
            return name;
        }
    }
}
